<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ question.question_text }} - 量子投票结果</title>
    <style>
        :root {
            --primary-color: #0ff0fc;
            --secondary-color: #ff2a6d;
            --success-color: #2dff7b;
            --dark-bg: #0d0221;
            --darker-bg: #070116;
            --text-color: #d1f7ff;
            --border-radius: 4px;
            --box-shadow: 0 0 15px rgba(0, 255, 252, 0.3);
            --neon-glow: 0 0 10px rgba(0, 255, 252, 0.8), 0 0 20px rgba(0, 255, 252, 0.6);
            --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        }

        body {
            font-family: 'Orbitron', 'Segoe UI', sans-serif;
            line-height: 1.6;
            color: var(--text-color);
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background-color: var(--dark-bg);
            background-image: 
                radial-gradient(circle at 25% 25%, rgba(15, 240, 252, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 75% 75%, rgba(255, 42, 109, 0.1) 0%, transparent 50%);
            position: relative;
            overflow-x: hidden;
        }

        body::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: 
                linear-gradient(135deg, transparent 49.5%, var(--primary-color) 49.5%, var(--primary-color) 50.5%, transparent 50.5%),
                linear-gradient(45deg, transparent 49.5%, var(--primary-color) 49.5%, var(--primary-color) 50.5%, transparent 50.5%);
            background-size: 30px 30px;
            opacity: 0.05;
            pointer-events: none;
            z-index: -1;
        }

        .results-container {
            background: rgba(13, 2, 33, 0.7);
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
            padding: 30px;
            margin-top: 20px;
            border: 1px solid rgba(0, 255, 252, 0.2);
            backdrop-filter: blur(5px);
            position: relative;
            overflow: hidden;
            transition: var(--transition);
        }

        .results-container:hover {
            box-shadow: var(--neon-glow);
            transform: translateY(-3px);
        }

        .results-container::before {
            content: "";
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(
                to bottom right,
                transparent 45%,
                rgba(0, 255, 252, 0.1) 50%,
                transparent 55%
            );
            transform: rotate(45deg);
            pointer-events: none;
        }

        h1 {
            color: var(--primary-color);
            margin-bottom: 25px;
            font-size: 1.8rem;
            text-align: center;
            text-shadow: 0 0 10px rgba(0, 255, 252, 0.5);
            letter-spacing: 1px;
            position: relative;
            padding-bottom: 15px;
        }

        h1::after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            height: 3px;
            background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
            box-shadow: var(--box-shadow);
        }

        .total-votes {
            text-align: center;
            margin-bottom: 25px;
            font-size: 1.1rem;
            color: var(--text-color);
            font-family: 'Courier New', monospace;
        }

        .total-votes span {
            font-weight: bold;
            color: var(--primary-color);
            text-shadow: 0 0 5px var(--primary-color);
        }

        .results-list {
            list-style: none;
            padding: 0;
            margin: 0 0 30px 0;
        }

        .result-item {
            margin-bottom: 15px;
            padding: 15px;
            background-color: rgba(15, 240, 252, 0.05);
            border-radius: var(--border-radius);
            display: flex;
            align-items: center;
            transition: var(--transition);
            border: 1px solid rgba(0, 255, 252, 0.3);
            position: relative;
            overflow: hidden;
        }

        .result-item:hover {
            transform: translateX(5px);
            box-shadow: var(--neon-glow);
            border-color: var(--primary-color);
        }

        .choice-text {
            flex: 1;
            font-weight: 500;
        }

        .votes-count {
            min-width: 100px;
            text-align: right;
            color: var(--success-color);
            font-weight: bold;
            font-family: 'Courier New', monospace;
            text-shadow: 0 0 5px rgba(45, 255, 123, 0.5);
        }

        .progress-container {
            flex: 2;
            margin: 0 15px;
            height: 8px;
            background-color: rgba(0, 255, 252, 0.1);
            border-radius: 5px;
            overflow: hidden;
            box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
        }

        .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
            border-radius: 5px;
            transition: width 1s ease-in-out;
            box-shadow: 0 0 10px var(--primary-color);
        }

        .action-buttons {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-top: 30px;
        }

        .btn {
            padding: 12px 25px;
            border: none;
            border-radius: var(--border-radius);
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            text-decoration: none;
            display: inline-block;
            text-align: center;
            font-family: 'Orbitron', sans-serif;
            position: relative;
            overflow: hidden;
            z-index: 1;
        }

        .btn-primary {
            background: linear-gradient(90deg, var(--primary-color), var(--success-color));
            color: #111;
        }

        .btn-primary:hover {
            box-shadow: 0 0 20px rgba(0, 255, 252, 0.7);
            transform: translateY(-3px);
        }

        .btn-secondary {
            background: linear-gradient(90deg, var(--secondary-color), #ff7b2d);
            color: #111;
        }

        .btn-secondary:hover {
            box-shadow: 0 0 20px rgba(255, 42, 109, 0.7);
            transform: translateY(-3px);
        }

        .btn:before {
            content: "";
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: 0.5s;
            z-index: -1;
        }

        .btn:hover:before {
            left: 100%;
        }

        /* 科技感装饰元素 */
        .tech-corner {
            position: absolute;
            width: 20px;
            height: 20px;
            border-color: var(--primary-color);
            border-style: solid;
            border-width: 0;
            opacity: 0.7;
        }

        .tech-corner-tl {
            top: 10px;
            left: 10px;
            border-top-width: 2px;
            border-left-width: 2px;
        }

        .tech-corner-tr {
            top: 10px;
            right: 10px;
            border-top-width: 2px;
            border-right-width: 2px;
        }

        .tech-corner-bl {
            bottom: 10px;
            left: 10px;
            border-bottom-width: 2px;
            border-left-width: 2px;
        }

        .tech-corner-br {
            bottom: 10px;
            right: 10px;
            border-bottom-width: 2px;
            border-right-width: 2px;
        }

        @media (max-width: 640px) {
            body {
                padding: 15px;
            }
            
            .results-container {
                padding: 20px;
            }
            
            h1 {
                font-size: 1.5rem;
            }
            
            .result-item {
                flex-direction: column;
                align-items: flex-start;
            }
            
            .progress-container {
                width: 100%;
                margin: 10px 0;
            }
            
            .action-buttons {
                flex-direction: column;
            }
            
            .btn {
                width: 100%;
            }
        }
    </style>
    <link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&display=swap" rel="stylesheet">
</head>
<body>
    <div class="results-container">
        <!-- 科技感边角装饰 -->
        <div class="tech-corner tech-corner-tl"></div>
        <div class="tech-corner tech-corner-tr"></div>
        <div class="tech-corner tech-corner-bl"></div>
        <div class="tech-corner tech-corner-br"></div>

        <h1>{{ question.question_text }}</h1>
    
        
        <ul class="results-list">
            {% for choice in question.choice_set.all %}
            <li class="result-item">
                <div class="choice-text">{{ choice.choice_text }}</div>
                <div class="progress-container">
                    <div class="progress-bar" style="width:  widthratio choicevotes questiontotal_votes 100 "></div>
                </div>
                <div class="votes-count">
                    {{ choice.votes }} 票 
                </div>
            </li>
            {% endfor %}
        </ul>
        
        <div class="action-buttons">
            <a href="{% url 'polls:detail' question.id %}" class="btn btn-primary">量子重投</a>
            <a href="{% url 'polls:index' %}" class="btn btn-secondary">返回量子中心</a>
        </div>
    </div>

    <script>
        // 添加科技感交互效果
        document.addEventListener('DOMContentLoaded', function() {
            const progressBars = document.querySelectorAll('.progress-bar');
            const buttons = document.querySelectorAll('.btn');
            const container = document.querySelector('.results-container');
            
            // 进度条动画效果
            progressBars.forEach(bar => {
                const originalWidth = bar.style.width;
                bar.style.width = '0';
                setTimeout(() => {
                    bar.style.width = originalWidth;
                }, 100);
            });
            
            // 按钮点击效果
            buttons.forEach(btn => {
                btn.addEventListener('click', function() {
                    this.style.transform = 'translateY(0)';
                });
            });
            
            // 随机闪烁效果
            setInterval(() => {
                if (Math.random() > 0.95) {
                    container.style.boxShadow = '0 0 20px rgba(255, 42, 109, 0.8)';
                    setTimeout(() => {
                        container.style.boxShadow = '';
                    }, 300);
                }
            }, 3000);
        });
    </script>
</body>
</html>